<template>
  <div class="sales">
    <div class="sales-heading">售后列表</div>
    <div class="sales-body">
      <ul class="media-list">
        <li class="media" v-for="o in orders" :key="o.time">
          <div class="media-left media-middle" style="border-right: 1px solid #f0f0f0;">
            <ul class="media-list">
              <li class="media" v-for="g in o.goods" :key="g.title">
                <div class="media-left media-middle">
                  <a class="media-a" href="#" :title="g.title">
                    <img class="media-object" :src="g.pic" :alt="g.title">
                  </a>
                </div>
                <div class="media-body media-middle">
                  <h5 class="media-heading">
                    <a href="#" :title="g.title">{{ g.title }}</a>
                  </h5>
                  <p class="text-gray-dark">￥{{ g.price }} × {{ g.number }}</p>
                </div>
              </li>
            </ul>
          </div>
          <div class="media-body media-middle media-all">
            <ul>
              <li>
                <strong :class="o.state === '退款成功'? 'text-green' : 'text-orange'">{{ o.state }}</strong>
              </li>
              <li>
                <span class="text-gray-dark">编号: {{ o.serialNumber }}</span>
              </li>
              <li>
                <span class="text-gray-dark">
                  <i class="el-icon-s-shop"></i>{{ o.store }}
                </span>
                <span class="text-gray" :title="o.time">{{o.time}}</span>
              </li>
            </ul>
          </div>
          <div class="media-right media-middle">
            <router-link class="icon-search" to="/member/showOneOrder" title="查看">
              <i class="el-icon-search"></i>
            </router-link>
          </div>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
  import {reactive} from 'vue'
  export default {
    name: "Order",
    setup(){
      let orders = reactive([
        {
          goods:[
            {
              title:'芭比波朗 晶亮奢金唇颊组合',
              pic:require('@/assets/image/dd1.jpg'),
              price:200,
              number:1,
            }
          ],
          state:'退款成功',
          serialNumber:'2021012710109292',
          store:'小象电商',
          time:'2021-01-27 08:51:22',
        },
        {
          goods:[
            {
              title:'西门子干衣机 WT4HW5601W',
              pic:require('@/assets/image/dd2-1.jpg'),
              price:234.00,
              number:1,
            },
            {
              title:'*美赞臣 安儿宝儿童配方奶粉4段 800克',
              pic:require('@/assets/image/dd2-2.jpg'),
              price:200.00,
              number:1,
            },
            {
              title:'芭比波朗 纯色奢金绒雾唇膏笔',
              pic:require('@/assets/image/dd2-3.jpg'),
              price:120.00,
              number:4,
            }
          ],
          state:'退款中',
          serialNumber:'2021022110109595',
          store:'小象电商',
          time:'2021-02-21 14:50:46',
        },
      ])

      return {
        orders,
      }
    }
  }
</script>

<style scoped>
  *{
    font-size: 13px;
    color: #333;
  }
  a{
    text-decoration: none;
    color: #666666;
  }
  ul{
    list-style: none;
    padding-left: 0;
  }
  .text-orange{
    color: #f56a00;
  }
  .text-green{
    color: #00a854;
  }
  .text-red{
    color: red;
  }
  .sales{
    margin-bottom: 17px;
    background-color: #fff;
  }
  .sales-heading{
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
  }
  .sales-more{
    color: #bfbfbf;
    float: right;
  }
  .sales-body{
    padding: 15px;
  }
  .media {
    margin-top: 15px;
    overflow: hidden;
  }
  .media:first-child {
    margin-top: 0;
  }
  .media:not(:last-child){
    padding-bottom: 15px;
    border-bottom: 1px solid #eeeeee;
  }
  .media-body {
    overflow: hidden;
    display: table-cell;
    min-width: 300px;
    line-height: 25px;
  }
  .media-right{
    display: table-cell;
    min-width: 230px;
  }
  .media-left{
    padding-right: 10px;
    display: table-cell;
  }
  .media-middle {
    vertical-align: middle;
  }
  .media-a:hover .media-object{
    border-color: #ddd;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.08);
  }
  .media-object{
    max-width: 60px;
    transition: border-color 0.3s;
    padding: 4px;
    line-height: 1.42857143;
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
  }
  .media-heading{
    font-weight: normal;
    margin-top: 0;
    width: 400px;
    margin-bottom: 5px;
    line-height: 17px;
    overflow: hidden;
  }
  .media-heading a:hover{
    color: #409EFF;
  }
  .media-all{
    padding-left: 50px;
  }
  .text-gray-dark {
    color: #919191;
    margin: 0;
    padding-right: 10px;
  }
  .text-gray{
    color: #bfbfbf;
    padding-right: 10px;
  }
  .sum-icon{
    line-height: 30px;
  }
  .icon-search{
    float: right !important;
    margin-left: 10px;
    padding: 8px 10px;
    color: #666666;
    transition: all 0.3s;
    border: 1px #d8d8d8 solid;
    border-radius: 4px;
  }
  .icon-search i{
    transition: all 0.3s;
  }
  .icon-search:hover{
    border-color: #409EFF;
  }
  .icon-search:hover i{
    color: #409EFF;
  }
</style>